package ua.kharkov.knure.dereza.summarytask4.db.dao;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;

import ua.kharkov.knure.dereza.summarytask4.db.dto.StatusDTO;

/**
 * Basic interface for all StatusDAO
 * 
 * @author dereza
 * 
 */
public interface StatusDAO {
    
	/**
	 * Returns a status with the given id
	 * 
	 * @param status id
	 * @return StatusDTO
	 */
	public StatusDTO findStatusById(int id);
	
	/**
	 * Returns a id with the given status name
	 * 
	 * @param status name
	 * @return StatusDTO
	 */
	public StatusDTO findStatusByName(String name);

	/**
	 * Commits query and closes connection
	 * 
	 * @param rs
	 * @param ps
	 * @param conn
	 */
	public void commitAndClose(ResultSet rs, Statement ps, Connection conn);

	/**
	 * Rolls back the request
	 * 
	 * @param conn
	 */
	public void rollback(Connection conn);
}